package agentspeak.editors;

import org.eclipse.jface.text.*;
import org.eclipse.jface.text.rules.*;

public class ASLPlanScanner extends RuleBasedScanner {

	public ASLPlanScanner(ColorManager manager) {
		IToken id =
			new Token(
				new TextAttribute(manager.getColor(IASLColorConstants.ASL_PLAN_ID)));

		IToken expr =
				new Token(
					new TextAttribute(manager.getColor(IASLColorConstants.ASL_PLAN_EXPR)));
		
		IToken commandList =
				new Token(
					new TextAttribute(manager.getColor(IASLColorConstants.ASL_PLAN_COMMANDLIST)));
				
		
		IRule[] rules = new IRule[]{
				new SingleLineRule(" ", ":", id),
				new SingleLineRule(" ", "<-", expr),
				new MultiLineRule(" ", ".", commandList),
				
		};

		setRules(rules);
	}
}
